
<ul id="pagination">
    <?php if ($pager->haveToPaginate()): ?>
        <?php
        $paramtersHolder = array();
        
//        foreach ($sf_request->getGetParameters() as $k => $v)
//        {
//            if (is_object($v))
//            {
//                $array = array();
//                foreach ($v as $k1 => $v1)
//                {
//                    $array[$k1]          = $v1;
//                }
//                $v                   = $array;
//            }
//            $paramtersHolder[$k] = $v;
//        }
        ?>

        <?php if ($pager->isFirstPage()) : ?>
            <li class="previous-off"><a href="javascript:void(0)"> first page </a></li>
            <li class="previous-off"> <a href="javascript:void(0)">previous </a></li>
        <?php else: ?>
            <li class="previous"><a href="<?php echo url_for($routeName . '?page=' . '1') ?>" title="<?php echo __('first page') ?>"> first page </a></li>
            <li class="previous"><a href="<?php echo url_for($routeName . '?page=' . $pager->getPreviousPage()) ?>" title="<?php echo __('previous page') ?>" >previous  </a>
            <?php endif; ?>
            <?php foreach ($pager->getLinks() as $page): ?>
                <?php if ($page == $pager->getPage()): ?>
                <li class="active"><a href="javascript:void()"><?php echo $page ?></a></li>
            <?php else: ?>
                <li><a href="<?php echo url_for($routeName . '?page=' . $page) ?>"><?php echo $page ?></a> </li>
            <?php endif; ?>
        <?php endforeach; ?>
        <?php if ($pager->isLastPage()) : ?>
            <li class="next-off"> <a href="javascript:void(0)"> next </a> </li>
            <li class="next-off"> <a href="javascript:void(0)"> last page </a> </li>
        <?php else: ?> 
            <li class="next"><a href="<?php echo url_for($routeName . '?page=' . $pager->getNextPage()) ?>" title="<?php echo __('next page') ?>"> next </a></li>
            <li class="next"><a href="<?php echo url_for($routeName . '?page=' . $pager->getLastPage()) ?>" title="<?php echo __('last page') ?>"> last page </a></li>
        <?php endif; ?>
    <?php else: ?>
        <li class="previous-off">  <a href="javascript:void(0)">first page  </a></li>
        <li class="previous-off"> <a href="javascript:void(0)"> previous  </a></li>
        <li class="active"><a href="javascript:void()">1</a></li>
        <li class="next-off"> <a href="javascript:void(0)"> next  </a></li>
        <li class="next-off">  <a href="javascript:void(0)"> last page  </a> </li>
    <?php endif; ?>
</ul>

